|
2020-2021 Sunseeker Telemetry and Lighting System
|
#include "driverlib.h"Go to the source code of this file.
Functions | |
| void | main (void) |
| void | ADC12ISR (void) |
Variables | |
| volatile uint16_t | results [4] |
| void ADC12ISR | ( | void | ) |
Definition at line 217 of file adc12_a_ex7_sequence.c.
References __bic_SR_register_on_exit(), and results.
| void main | ( | void | ) |
Definition at line 84 of file adc12_a_ex7_sequence.c.
References __no_operation().
| volatile uint16_t results[4] |
ADC12_A - Sample A0-3 Input, AVcc Ref, Non-Repeated Sequence of Conversions
This example shows how to perform A/D conversions on a sequence of channels. A single sequence of conversions is performed - one conversion each on channels A0, A1, A2, and A3. Each conversion uses AVcc and AVss for the references. The conversion results are stored in ADC12MEM0, ADC12MEM1, ADC12MEM2, and ADC12MEM3 respectively and are moved to 'results[]' upon completion of the sequence. Test by applying voltages to pins A0, A1, A2, and A3, then setting and running to a break point at the "_BIC..." instruction in the ISR. To view the conversion results, open a watch window in debugger and view 'results' or view ADC12MEM0, ADC12MEM1, ADC12MEM2, and ADC12MEM3 in an ADC12_A SFR window. This can run even in LPM4 mode as ADC has its own clock Note that a sequence has no restrictions on which channels are converted. For example, a valid sequence could be A0, A3, A2, A4, A2, A1, A0, and A7. See the MSP430x5xx User's Guide for instructions on using the ADC12_A.
MSP430F552x
-----------------
/|\| |
| | P6.0/A0|<- Vin0
--|RST P6.1/A1|<- Vin1
| P6.2/A2|<- Vin2
| P6.3/A3|<- Vin3
| |
This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:
This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.
Definition at line 82 of file adc12_a_ex7_sequence.c.
Referenced by ADC12ISR().